package com.huyaanalysisplatform.controller;


import com.huyaanalysisplatform.entity.TBlueRay;
import com.huyaanalysisplatform.entity.TLiveCount;
import com.huyaanalysisplatform.service.TLiveCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huyaanalysisplatform.controller.BaseController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Huadi Group 12
 * @since 2021-08-01
 */
@RestController
@RequestMapping
@CrossOrigin
public class TLiveCountController extends BaseController {
    @Autowired
    TLiveCountService tLiveCountService;

    @RequestMapping({"/home/function4"})//功能4，四个分区的开播数量
    @ResponseBody
    public Map queryAllArea() {
        Map map = new HashMap();
        map = tLiveCountService.queryAllArea(map);
        return map;
    }

    @RequestMapping("/home/function4/table")//功能11
    @ResponseBody
    public Map queryHotHero() {
        Map map;
        map = tLiveCountService.queryLiveCount();
        return map;
    }

    @RequestMapping("/home/function4/add")//功能11
    @ResponseBody
    public Map addHotHero(@RequestBody TLiveCount tLiveCount) {
        Map map;
        map = tLiveCountService.addLiveCount(tLiveCount);
        return map;
    }

    @RequestMapping({"/home/function4/edit"})//功能11
    @ResponseBody
    public Map editHotHero(@RequestBody TLiveCount tLiveCount) {
        Map map;
        map = tLiveCountService.editLiveCount(tLiveCount);
        return map;
    }

    @RequestMapping({"/home/function4/delete"})//功能11
    @ResponseBody
    public Map deleteHotHero(String id) {
        Map map;
        map = tLiveCountService.deleteLiveCount(id);
        return map;
    }

    @RequestMapping({"/home/function5"})//功能5,全平台开播数量
    @ResponseBody
    public Map queryAll() {
        Map map = new HashMap();
        map = tLiveCountService.queryAll(map);
        return map;
    }

    @RequestMapping({"/home/function6/first"})//功能6,预测
    @ResponseBody
    public Map queryFirst() {
        Map map = new HashMap();
        map = tLiveCountService.queryFirst();
        return map;
    }

    @RequestMapping({"/home/function6/second"})//功能6,预测
    @ResponseBody
    public Map querySecond() {
        Map map = new HashMap();
        map = tLiveCountService.querySecond();
        return map;
    }

    @RequestMapping({"/home/function6/third"})//功能6,预测
    @ResponseBody
    public Map queryThird() {
        Map map = new HashMap();
        map = tLiveCountService.queryThird();
        return map;
    }

    @RequestMapping({"/home/function6/fourth"})//功能6,预测
    @ResponseBody
    public Map queryFourth() {
        Map map = new HashMap();
        map = tLiveCountService.queryFourth();
        return map;
    }


    @PostMapping("/livecount/rate")
    public Map<String, List<Map<String, Object>>> rate() {
        return tLiveCountService.rate();
    }

}
